#include "..\System.h"

/*[ Forward-declare ]*/
extern static_ bool TrySZReverse(Array array, int_ index, int_ count);
extern static_ bool TrySZSort(Array keys, Array items, int_ left, int_ right);
internal static_ void space(System_Array,Copy5)(Array sourceArray, int_ sourceIndex, Array destinationArray, int_ destinationIndex, int_ length, bool reliable);

/*[ TrySZReverse ] */
extern static_ bool TrySZReverse(Array array, int_ index, int_ count)
{
	return true;
}

/*[ TrySZSort ] */
extern static_ bool TrySZSort(Array keys, Array items, int_ left, int_ right)
{
	return true;
}


/*[ Clear ] */
public void space(System_Array,Clear)(Array array, int_ index, int_ length)
{
}

/*[ Copy ] */
public void space(System_Array,Copy)(Array sourceArray, Array destinationArray, int_ length)
{
	if (sourceArray == null)
	{
		throw(ArgumentNullException, L"sourceArray");
	}
	if (destinationArray == null)
	{
		throw(ArgumentNullException, L"destinationArray");
	}
	space(System_Array,Copy5)(sourceArray, 0, destinationArray, 0, length, false);
}
/*[ Copy2 ] */
public void space(System_Array,Copy2)(Array sourceArray, Array destinationArray, long_ length)
{
	//if ((length > 0x7fffffffL) || (length < -2147483648L))
	//{
	//	throw(ArgumentOutOfRangeException, L"length");
	//}
	space(System_Array,Copy)(sourceArray, destinationArray, (int_)length);
}
/*[ Copy3 ] */
public void space(System_Array,Copy3)(Array sourceArray, int_ sourceIndex, Array destinationArray, int_ destinationIndex, int_ length)
{
}
/*[ Copy4 ] */
public void space(System_Array,Copy4)(Array sourceArray, long_ sourceIndex, Array destinationArray, long_ destinationIndex, long_ length)
{
	//if ((sourceIndex > 0x7fffffffL) || (sourceIndex < -2147483648L))
	//{
	//	throw(ArgumentOutOfRangeException, L"sourceIndex");
	//}
	//if ((destinationIndex > 0x7fffffffL) || (destinationIndex < -2147483648L))
	//{
	//	throw(ArgumentOutOfRangeException, L"destinationIndex");
	//}
	//if ((length > 0x7fffffffL) || (length < -2147483648L))
	//{
	//	throw(ArgumentOutOfRangeException, L"length");
	//}
	space(System_Array,Copy3)(sourceArray, (int_)sourceIndex, destinationArray, (int_)destinationIndex, (int_)length);
}
/*[ Copy5 ] */
internal static_ void space(System_Array,Copy5)(Array sourceArray, int_ sourceIndex, Array destinationArray, int_ destinationIndex, int_ length, bool reliable)
{
}

/*[ Reverse ] */
public static_ void space(System_Array,Reverse)(Array array)
{
	if (array == null)
	{
		throw(ArgumentNullException, L"array");
	}
	space(System_Array,Reverse2)(array, 0, array_getLength(array));
}
/*[ Reverse2 ] */
public static_ void space(System_Array,Reverse2)(Array array, int_ index, int_ length)
{
	if (array == null)
	{
		throw(ArgumentNullException, L"array");
	}
	if ((index < 0) || (length < 0))
	{
		throw(ArgumentOutOfRangeException, (index < 0 ? L"index" : L"length"));
	}
	if ((array_getLength(array) - (index - 0)) < length)
	{
		throw(ArgumentException, L"Argument_InvalidOffLen");
	}
	if (TrySZReverse(array, index, length) == false)
	{
		//int_ num = index;
		//int_ num2 = (index + length) - 1;
		//System_Object *objArray = array;
		//while (num < num2)
		//{
		//	System_Object *obj2 = objArray[num];
		//	objArray[num] = objArray[num2];
		//	objArray[num2] = obj2;
		//	num++;
		//	num2--;
		//}
	}
}
